<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>index</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
    <script th:inline="javascript">
        function run() {
            let s = document.getElementById("dd");
            if (s.innerText === '0') {
                // alert(11);
                window.location.href = '/order/getList/' + [[${order_id}]];
                return false;
            }
            s.innerHTML = s.innerHTML * 1 - 1;
        }

        window.setInterval("run();", 1000);

        function pay() {
            window.location.href = '/order/success/' + [[${order_id}]];
        }
    </script>
</head>
<body>
请在<span id="dd">10</span>秒内完成支付
<br/>
订单编号：<span th:text="${order_id}"></span>
<br/>
<input type="button" onclick="pay()" value="支付"/>
</body>
</html>